package com.shiminghui;

import java.util.Random;
import java.util.Scanner;

public class ShuangSeQiu {
    public static void main(String[] args) {
        Random random = new Random();
        Scanner scanner = new Scanner(System.in);
        int[] arr = new int[7];
        for (int i = 0; i < arr.length - 1; i++) {
            int temp = random.nextInt(33) + 1;
            if (!contains(arr, temp)) {
                arr[i] = temp;
            } else {
                i--;
            }
        }
        arr[arr.length - 1] = random.nextInt(16) + 1;
        for (int j : arr) {
            System.out.print(j + " ");
        }
        System.out.println();
        int[] newArr = new int[7];
        for (int i = 0; i < newArr.length - 1; i++) {
            int temp = scanner.nextInt();
            if (temp >= 1 && temp <= 33) {
                if (!contains(newArr, temp)) {
                    newArr[i] = temp;
                } else {
                    System.out.println("已存在,请重新输入");
                    i--;
                }
            } else {
                System.out.println("输入不合法(1-33)");
                i--;
            }
        }
        newArr[newArr.length - 1] = scanner.nextInt();

        int countRed = getSame(arr, newArr);
        int countBlue = arr[arr.length - 1] == newArr[newArr.length - 1] ? 1 : 0;
        if ((countRed == 0 || countRed == 1) && countBlue == 1) {
            System.out.println(5);
        }
        if ((countRed == 2 || countRed == 3) && countBlue == 1) {
            System.out.println(10);
        }
        if (countRed == 4) {
            System.out.println(200);
        }
        if (countRed == 5) {
            System.out.println(3000);
        }
        if (countRed == 6 && countBlue == 0) {
            System.out.println(5000000);
        }
        if (countRed == 6 && countBlue == 1) {
            System.out.println(10000000);
        }
        if (countRed==0&&countBlue==0){
            System.out.println("谢谢惠顾");
        }
    }

    private static int getSame(int[] arr, int[] newArr) {
        int count = 0;
        for (int i = 0; i < arr.length - 1; i++) {
            for (int i1 = 0; i1 < newArr.length - 1; i1++) {
                if (arr[i] == newArr[i1]) {
                    count++;
                }
            }
        }
        return count;
    }

    private static boolean contains(int[] arr, int temp) {
        for (int j : arr) {
            if (j == temp) {
                return true;
            }
        }
        return false;
    }
}
